﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using System.Data;
using System.Data.SqlClient;


namespace DAO
{
    public partial class PhanCong_DAO
    {
        public DataTable LayDanhSachPhanCong()
        {
            DataProvider dp = new DataProvider();
            DataTable dt = new DataTable();
            dt = dp.ExecuteQuery("LayDanhSachPhanCong");
            return dt;
        }

        public DataTable ThemMoiPhanCong(PhanCong PhanCong)
        {
            DataProvider dp = new DataProvider();
            DataTable dt = new DataTable();
            SqlParameter[] Parameter = new SqlParameter[2];

            Parameter[0] = new SqlParameter("@NgayBatDau", PhanCong.NgayBatDau);
            Parameter[1] = new SqlParameter("@NgayketThuc", PhanCong.NgayKetThuc);
            dt = dp.ExecuteQuery("ThemMoiPhanCong",Parameter);
            return dt;
        }

        public DataTable ChiTietPhanCong(string MaPhanCong, string MaNhanVien)
        {
            DataProvider dp = new DataProvider();
            DataTable dt = new DataTable();
            SqlParameter[] Parameter = new SqlParameter[2];

            Parameter[0] = new SqlParameter("@MaPhanCong", MaPhanCong);
            Parameter[1] = new SqlParameter("@MaNhanVien", MaNhanVien);
            dt = dp.ExecuteQuery("ChiTietPhanCong", Parameter);
            return dt;
        }
    }
}
